﻿using System;
public class Rectangle
{
    public double Length { get; set; }
    public double Width { get; set; }
    public Rectangle(double length, double width)
    {
        Length = length;
        Width = width;
    }

    public double CalculatePerimeter()
    {
        return 2 * (Length + Width);
    }
    
    public double CalculateArea()
    {
        return Length * Width;
    }
}
class 第一题
{
    static void Main(string[] args)
    {
        Rectangle rect1 = new Rectangle(2, 2);
        Rectangle rect2 = new Rectangle(2, 4);

        Console.WriteLine("第一个长方形:");
        Console.WriteLine($"长: {rect1.Length}, 宽: {rect1.Width}");
        Console.WriteLine($"周长: {rect1.CalculatePerimeter()}");
        Console.WriteLine($"面积: {rect1.CalculateArea()}\n");

        Console.WriteLine("第二个长方形:");
        Console.WriteLine($"长: {rect2.Length}, 宽: {rect2.Width}");
        Console.WriteLine($"周长: {rect2.CalculatePerimeter()}");
        Console.WriteLine($"面积: {rect2.CalculateArea()}");
    }
}
